﻿<Window x:Class="Bio.Views.Alignment.Views.FindSearchView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
        xmlns:julmar="http://www.julmar.com/wpfhelpers"
        Title="Find" ShowInTaskbar="False" ResizeMode="NoResize" Width="300" Height="200" 
        WindowStartupLocation="CenterOwner" Background="#FF595959"
        FocusManager.FocusedElement="{Binding ElementName=tb}">
    <Grid>
        
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        
        <Label Content="_Search For:" Margin="5" />
        <TextBox x:Name="tb" HorizontalAlignment="Stretch" Margin="5" Grid.Column="1" Text="{Binding SearchString, UpdateSourceTrigger=PropertyChanged}" />
        
        <Expander Grid.Row="1" Grid.ColumnSpan="2" Header="Find Options" IsExpanded="True">
            <StackPanel>
                <CheckBox Margin="5" Content="Match _whole name"  IsChecked="{Binding MatchWholeName}" ToolTip="Match complete names" />
                <CheckBox Margin="5" Content="Search _up"  IsChecked="{Binding SearchBackward}" ToolTip="Search up from the current position" />
            </StackPanel>
        </Expander>
        
        <StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Content="Find _Next" IsDefault="True" Command="{Binding FindNext}" CommandParameter="{Binding}" Margin="5" Padding="10,5" />
            <Button Content="Close" IsCancel="True" Margin="5" Padding="10,5">
                <Interactivity:Interaction.Behaviors>
                    <julmar:CloseDialogBehavior DialogResult="false" />
                </Interactivity:Interaction.Behaviors>
            </Button>
        </StackPanel>
         
    </Grid>
</Window>
